package DataView;

import java.util.Vector;

import Store.Class;
import Store.Enumeration;

public class ClassDiagramInfo extends ElementInfo 
{
	private Class contextClass;
	private Vector<Class> lista_Classi = new Vector<Class>();
	private Vector<Enumeration> lista_Enumeration = new Vector<Enumeration>();
	
	public void setInfo(Class context, Vector<Class> lista_Classi, Vector<Enumeration> lista_Enumeration) 
	{
		this.contextClass=context;
		this.lista_Classi=lista_Classi;
		this.lista_Enumeration=lista_Enumeration;
	}
	
	public Vector<Class> getClassi()
	{
		return lista_Classi;
	}
	
	public Vector<Enumeration> getEnums()
	{
		return lista_Enumeration;
	}
	
	public Class getContext()
	{
		return contextClass;
	}

	public void setContext(Class aClass) 
	{
		this.contextClass=aClass;
	}
	
	public ClassDiagramInfo clone()
	{
		ClassDiagramInfo clone = new ClassDiagramInfo();
		Class cx = null;
		Vector<Class> vcClone = new Vector<Class>();
		Vector<Enumeration> veClone = new Vector<Enumeration>();
		for(Class c : lista_Classi)
			vcClone.add( (Class) c.clone());
		for(Class c : vcClone)
			if(c.getName()==contextClass.getName())
				cx=c;
		for(Enumeration e : lista_Enumeration)
			veClone.add((Enumeration) e.clone());
		
		clone.setInfo(cx, vcClone, veClone);
		
		return clone;
	}
}
